/*
Class Name      : LiveAgentLoginCheck
Created by      : Rucha Kulkarni
Created On      : 22/04/2013
Description     : This class is used to identify if value is presen in Account/Lead
Version         : 1.0               
*/

public without Sharing class LiveAgentLoginCheck {

@RemoteAction
    public static boolean Login(String fName, String email) {
        List<Lead> leadInfo = [SELECT Name, Email FROM Lead WHERE Email=:email limit 1];
        if(!leadInfo.isEmpty())
            //if(email == leadInfo[0].Email)
                return (true);       
       return (false);
    }
    
@RemoteAction
    public static boolean LoginAccount(String fName, String email) {
        List<Account> accountInfo = [SELECT Name, PersonEmail FROM Account WHERE PersonEmail=:email];
        if(accountInfo != NULL && !accountInfo.isEmpty())
            //if(email == accountInfo[0].PersonEmail)
                return (true);        
        return (false);
    }
}